import React, { Component } from 'react';
import {View, Image} from '@tarojs/components';
import {AtIcon} from "taro-ui";
import {gotoPage} from "../../../../utils/tools";
import GoodsBigImgList from "../../../../components/goods-big-img-list/goods-big-img-list";
import './index.scss';

interface IProps {
  data: any
  isUser: any
}

export default class ShangxinToday extends Component<IProps> {

  constructor(props: IProps) {
    super(props);
  }

  render() {
    const {data, isUser} = this.props;
    return (
      <View className='recommendation-wrap'>
        <View className='recommendation'>
          <View className='recommendation-title'>
            <View className='recommendation-title-left'>
              <Image src={data.titleIcon} className='imageStyle' />
              {data.name}
            </View>
            <View className='recommendation-title-right'>
              <View className='ret' onClick={() => gotoPage(data.moreUrl)}>
                更多
                <AtIcon value='chevron-right' size='16' color='#666' />
              </View>
            </View>
          </View>
          <GoodsBigImgList isRecommendation data={data ? data.data : []} isUser={isUser} />
        </View>
      </View>
    )
  }
}
